package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.zzyl.base.ResponseResult.success;

@RestController
@RequestMapping("/customer/orders")
@Api(tags = "客户服务管理")
public class CustomerServeController {

@Autowired
    private NursingProjectService nursingProjectService;


    @ApiOperation("分页条件查询护理项目")
    @GetMapping("/project/page")
    public ResponseResult selectByPage(@ApiParam(value = "护理项目名称") String name, Integer status, Integer pageNum, Integer pageSize){
        PageResponse pageResponse = nursingProjectService.selectByPage(name, status, pageNum, pageSize);
        return success(pageResponse);
    }

    @GetMapping("/project/{id}")
    public ResponseResult<NursingProjectVo> getById(@PathVariable("id") Long id){
        NursingProjectVo nursingProjectVo = nursingProjectService.findById(id);
        return success(nursingProjectVo);
    }


}
